// 函子
class Container {
  static of(value) {
    return new Container(value)
  }

  constructor(value) {
    this._value = value;// 不对外公布
  }

  map(fn) {
    return Container.of(fn(this._value));// 处理_value
  }
}

const r = Container.of(5)
  .map(x => x + 2)
  .map(x => x * x)
  .map(x => x + 5);

console.log(r)